export function copyText(text: string) {
  // Create a textarea element
  const textarea = document.createElement('textarea');

  // Assign the text content to be copied
  textarea.value = text;

  // Append the textarea element to the DOM
  document.body.appendChild(textarea);

  // Select the text in the textarea
  textarea.select();

  // Copy the selected text to the clipboard
  document.execCommand('copy'); // alternativly, navigator.clipboard.writeText(text)

  // Remove the textarea from the DOM
  document.body.removeChild(textarea);
}
